package com.kingyun.gpsinspection.purificationservice.facade.service.iam.adm;

import com.kingyun.gpsinspection.purificationservice.facade.model.iam.adm.Leave;
import com.kingyun.gpsinspection.purificationservice.facade.model.iam.adm.LeaveHistoricProcessInstanceEntity;
import com.kingyun.gpsinspection.purificationservice.facade.model.iam.adm.LeaveTaskEntity;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EmployeeVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.OrgLevel;

import java.text.ParseException;
import java.util.Map;

/**
 * 请假服务接口
 *
 * @author zjh
 * @since 20170704
 */
public interface LeaveService {


    /**
     * 保存请假业务实体并发起审批
     *
     * @param leave      请假业务
     * @param employeeVo 当前登录人
     * @return
     */
    Map<String, Object> saveLeave(Leave leave, EmployeeVo employeeVo) throws Exception;


    /**
     * 得到年假的剩余天数
     *
     * @param employeeVo
     * @return
     */
    Integer queryMannualDays(String employeeId, EmployeeVo employeeVo) throws ParseException;


    /**
     * 得到请假实体
     *
     * @param id
     * @return
     */
    Leave queryLeaveById(String id);


    /**
     * 某人发起的流程列表
     *
     * @param leaveHistoricProcessInstanceEntity
     * @return
     */
    Map<String, Object> getRunningProcessinstances(LeaveHistoricProcessInstanceEntity leaveHistoricProcessInstanceEntity);


    /**
     * 得到待办任务列表
     *
     * @param leaveTaskEntity
     * @return
     */
    Map<String, Object> getTodoTasks(LeaveTaskEntity leaveTaskEntity);


    /**
     * 驳回请求，重新填写
     *
     * @param leave    业务实体
     * @param taskId   任务ID
     * @param variable 流程变量
     * @param userId   用户id
     * @return
     */
    Map<String, Object> reApply(Leave leave, String taskId, Map<String, Object> variable, String userId);

    /**
     * 根据当前人员的组织id查询组织层级信息，及其父级层级信息
     *
     * @param orgId
     */
    OrgLevel queryLevelInfoByOrgId(String orgId);
}
